<template>
<view>
	<view class="title">
		{{info.name}}
	</view>
	<view class="video">
		<video id="myVideo" v-if="info.video" :src="imgUrl+info.video"
				enable-danmu danmu-btn controls>
		</video>
		<image v-if="info.picture" :src="imgUrl+info.picture" />
	</view>
	<view class="out">
	    <view class="ctext">
	        <view class="line"></view>
	        <view>课程简介</view>
	    </view>
	    <image class="xing" src="/static/img/cang1.png" />
	 </view>
	 <view v-if="info.content" class="txt">{{info.content}}</view>
	 <rich-text v-if="info.content1" :nodes="info.content1"></rich-text>
</view>
</template>
<script>
import request from '@/util/request.js'	
export default {
	data() {
		return {
			imgUrl:this.url,
			info:{}
		}
	},
	onLoad:function(e){
		uni.showLoading({
		    title: '加载中'  
		});
		this.getCourse(e.id)
	},
	methods: {
		getCourse:function(id){
			var that = this;
			var data = {'id':id}
			request({
				url: 'course/info',
				method: 'get',
				data:data,
				success: (res) => {
					uni.hideLoading();
					that.info = res.data.data
					if(res.data.data.content1){
						that.info.content1 = res.data.data.content1.replace(/\<img src="/gi, '<img src="https://www.tymyztc.com');
					}
				}
			})
		}
	}
}
</script>
<style scoped>
	@import url("./info.css");
</style>